package com.zsrt.javase.c008.t01.p05;


import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import org.junit.Test;

public class CircleTest {
	
	
	@Test
	public void testName() throws Exception {
		Circle circle = new Circle();
		
		//将Circle对象写进文件  
		File file = new File("src/main/java/com/zsrt/javase/c008/t01/p05/scott.txt");
		ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(file));  
        os.writeObject(circle);
        os.close();
        
        
        //从流中读取User的数据  
        ObjectInputStream is = new ObjectInputStream(new FileInputStream(file));  
        Circle c = (Circle) is.readObject(); 
        System.out.println(c);
        is.close();
        
	}

}
